﻿using GedeaProject.Entities;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace GedeaProject.Business.Parsers
{
    public class DebitStandardParser
    {
        public string GetFormattedText(DebitOrder debitOrder)
        {
            int registryIndex = 0;
            StringBuilder resultBuilder = new StringBuilder();
            var transactionParser = new TransactionStandardParser();

            foreach(var transaction in debitOrder.Transactions)
            {
                resultBuilder.Append(transactionParser.GetFormattedText(transaction, registryIndex));
                registryIndex++;
            }

            return resultBuilder.ToString();
        }
    }
}
